﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace Loki.Model
{
	/// <summary>
	/// Base class for entities
	/// </summary>
	public abstract class Entity<TModel> : TrackedObject, IApplicationModelAware<TModel>
	{
		#region Constructors
		/// <summary>
		/// Initializes a new instance of the <see cref="Entity"/> class.
		/// </summary>
		public Entity()
		{

		}

		/// <summary>
		/// Initializes a new instance of the <see cref="Entity"/> class.
		/// </summary>
		/// <param name="P_Clone">The p_ clone.</param>
		public Entity(Entity<TModel> P_Clone)
		{
			_IsDirty = P_Clone.IsDirty;
		}
		#endregion

		#region Model
		/// <summary>
		/// Gets the application model.
		/// </summary>
		/// <value>
		/// The application model.
		/// </value>
		public TModel ApplicationModel
		{
			get { return ContextHelper.GetApplicationModel<TModel>(); }
		}
		#endregion
	}
}
